//
//  TelTableViewCell.m
//  Express
//
//  Created by lanou on 16/1/12.
//  Copyright © 2016年 FJY. All rights reserved.
//

#import "TelTableViewCell.h"

@implementation TelTableViewCell

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        _expressCompanyIV = [[UIImageView alloc] initWithFrame:CGRectMake(0, 10, 50, self.frame.size.height)];
        [self.contentView addSubview:_expressCompanyIV];
        
        _expressCompanyName = [[UILabel alloc] initWithFrame:CGRectMake(_expressCompanyIV.frame.origin.x + _expressCompanyIV.frame.size.width + 20 , 10, kWidth/1.5, self.frame.size.height/2)];
        [self.contentView addSubview:_expressCompanyName];
        
        _expressTel = [[UILabel alloc] initWithFrame:CGRectMake(_expressCompanyIV.frame.size.width + 20 , _expressCompanyName.frame.origin.y + _expressCompanyName.frame.size.height + 10, kWidth/2, self.frame.size.height/2 - 10)];
        [self.contentView addSubview:_expressTel];
    }
    return self;
}

- (void)setExpress:(Express *)express {
    if (_express != express) {
        _express = express;
        _expressCompanyName.text = express.expressName;
        _expressTel.text = express.expressTelephone;
        _expressCompanyIV.image = [UIImage imageNamed:@"icon_menu_mine"];
        _expressCompanyIV.backgroundColor = [UIColor purpleColor];
    }
}

@end
